<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>虚拟银行系统 - 提现</title>
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
  <link rel="stylesheet" href="/css/main.css">
  <style>
    /* Withdraw page specific styles */
    .withdraw-container {
      max-width: 600px;
      margin: 0 auto;
    }
    
    .withdraw-card {
      margin-bottom: var(--spacing-lg);
    }
    
    .bank-card-selector {
      margin-bottom: var(--spacing-md);
    }
    
    .bank-card-item {
      display: flex;
      align-items: center;
      padding: var(--spacing-md);
      border: 1px solid var(--divider-color);
      border-radius: var(--border-radius-md);
      margin-bottom: var(--spacing-sm);
      cursor: pointer;
      transition: all 0.3s;
    }
    
    .bank-card-item:hover {
      border-color: var(--primary-color);
      background-color: rgba(26, 58, 143, 0.05);
    }
    
    .bank-card-item.selected {
      border-color: var(--primary-color);
      background-color: rgba(26, 58, 143, 0.1);
    }
    
    .bank-card-radio {
      margin-right: var(--spacing-md);
    }
    
    .bank-card-info {
      flex: 1;
    }
    
    .bank-logo {
      width: 40px;
      height: 40px;
      border-radius: var(--border-radius-sm);
      margin-right: var(--spacing-md);
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: bold;
      color: white;
    }
    
    .bank-logo.icbc {
      background-color: #C50F1C;
    }
    
    .bank-logo.abc {
      background-color: #319C8B;
    }
    
    .bank-logo.boc {
      background-color: #D81E06;
    }
    
    .bank-logo.ccb {
      background-color: #0066B3;
    }
    
    .bank-name {
      font-weight: 500;
      margin-bottom: 4px;
    }
    
    .bank-card-number {
      color: var(--light-text);
      font-size: 13px;
    }
    
    .amount-group {
      margin-bottom: var(--spacing-lg);
    }
    
    .amount-input-wrapper {
      display: flex;
      align-items: center;
      margin-bottom: var(--spacing-sm);
    }
    
    .amount-currency {
      font-size: 24px;
      margin-right: var(--spacing-sm);
      color: var(--text-color);
      font-weight: 500;
    }
    
    .amount-input {
      font-size: 24px;
      border: none;
      outline: none;
      flex: 1;
      padding: var(--spacing-sm) 0;
      border-bottom: 2px solid var(--divider-color);
    }
    
    .amount-input:focus {
      border-bottom-color: var(--primary-color);
    }
    
    .available-balance {
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 13px;
      color: var(--light-text);
    }
    
    .withdraw-all {
      color: var(--primary-color);
      cursor: pointer;
      text-decoration: underline;
    }
    
    .quick-amount-options {
      display: flex;
      flex-wrap: wrap;
      gap: var(--spacing-sm);
      margin-top: var(--spacing-md);
    }
    
    .quick-amount-option {
      padding: var(--spacing-sm) var(--spacing-md);
      border: 1px solid var(--divider-color);
      border-radius: var(--border-radius-sm);
      cursor: pointer;
      transition: all 0.3s;
    }
    
    .quick-amount-option:hover, .quick-amount-option.selected {
      border-color: var(--primary-color);
      background-color: rgba(26, 58, 143, 0.1);
      color: var(--primary-color);
    }
    
    .withdraw-notice {
      font-size: 13px;
      color: var(--light-text);
      margin-top: var(--spacing-md);
      padding: var(--spacing-md);
      background-color: rgba(250, 173, 20, 0.1);
      border-radius: var(--border-radius-md);
      border-left: 3px solid var(--warning-color);
    }
    
    .withdraw-notice-title {
      font-weight: 500;
      color: var(--text-color);
      margin-bottom: var(--spacing-xs);
      display: flex;
      align-items: center;
    }
    
    .withdraw-notice-title i {
      margin-right: var(--spacing-sm);
      color: var(--warning-color);
    }
    
    .withdraw-notice ul {
      margin: var(--spacing-sm) 0 0;
      padding-left: var(--spacing-lg);
    }
    
    .withdraw-notice li {
      margin-bottom: var(--spacing-xs);
    }
    
    .withdraw-notice li:last-child {
      margin-bottom: 0;
    }
    
    .withdraw-history {
      margin-top: var(--spacing-xl);
    }
    
    .withdraw-history h3 {
      margin-bottom: var(--spacing-md);
    }
    
    .history-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: var(--spacing-md) 0;
      border-bottom: 1px solid var(--divider-color);
    }
    
    .history-item:last-child {
      border-bottom: none;
    }
    
    .history-info {
      display: flex;
      flex-direction: column;
    }
    
    .history-date {
      font-size: 13px;
      color: var(--light-text);
      margin-top: 2px;
    }
    
    .history-amount {
      font-weight: 500;
    }
    
    .history-status {
      font-size: 13px;
      padding: 2px 8px;
      border-radius: 12px;
    }
    
    .history-status.success {
      background-color: rgba(82, 196, 26, 0.1);
      color: var(--success-color);
    }
    
    .history-status.pending {
      background-color: rgba(250, 173, 20, 0.1);
      color: var(--warning-color);
    }
    
    .history-status.failed {
      background-color: rgba(245, 34, 45, 0.1);
      color: var(--error-color);
    }
    
    @media (max-width: 768px) {
      .withdraw-container {
        padding: 0 var(--spacing-md);
      }
    }
  </style>
</head>
<body>
  <div class="app-wrapper">
    <!-- Top Navigation Bar -->
    <div id="top-navbar"></div>
    
    <div class="main-container">
      <!-- Sidebar -->
      <div id="sidebar"></div>
      
      <!-- Main Content -->
      <div class="content">
        <div class="page-header">
          <div class="page-title">提现</div>
          <div class="breadcrumb">
            <a href="/index.html">首页</a>
            <i class="fas fa-angle-right"></i>
            <span>提现</span>
          </div>
        </div>
        
        <div class="withdraw-container">
          <!-- Bank Card Selection -->
          <div class="card withdraw-card">
            <div class="card-header">
              <h3 class="card-title">选择银行卡</h3>
              <a href="/bankcards.html" class="btn-link">管理银行卡</a>
            </div>
            <div class="card-body">
              <div id="bank-card-list" class="bank-card-selector">
                <div class="loader-container">
                  <div class="loader"></div>
                </div>
              </div>
            </div>
          </div>
          
          <!-- Withdraw Amount -->
          <div class="card withdraw-card">
            <div class="card-header">
              <h3 class="card-title">提现金额</h3>
            </div>
            <div class="card-body">
              <div class="amount-group">
                <div class="amount-input-wrapper">
                  <span class="amount-currency">¥</span>
                  <input type="number" id="amount-input" class="amount-input" placeholder="请输入提现金额" min="0" step="0.01">
                </div>
                <div class="available-balance">
                  <span>可用余额: <span id="available-balance">¥0.00</span></span>
                  <span class="withdraw-all" id="withdraw-all">全部提现</span>
                </div>
                <div class="quick-amount-options">
                  <div class="quick-amount-option" data-amount="100">¥100</div>
                  <div class="quick-amount-option" data-amount="500">¥500</div>
                  <div class="quick-amount-option" data-amount="1000">¥1000</div>
                  <div class="quick-amount-option" data-amount="5000">¥5000</div>
                  <div class="quick-amount-option" data-amount="10000">¥10000</div>
                </div>
              </div>
              
              <div class="form-group">
                <label for="password">安全密码</label>
                <div class="input-wrapper">
                  <input type="password" id="password" placeholder="请输入安全密码" class="form-control">
                  <div class="input-icon">
                    <i class="fas fa-lock"></i>
                  </div>
                </div>
              </div>
              
              <div class="withdraw-notice">
                <div class="withdraw-notice-title">
                  <i class="fas fa-exclamation-circle"></i>
                  提现须知
                </div>
                <ul>
                  <li>提现到账时间: 工作日 09:00-17:00 实时到账，非工作时间于下一工作日处理</li>
                  <li>单笔提现金额: 最低100元，最高50000元</li>
                  <li>每日提现限额: 100000元</li>
                  <li>提现手续费: 免费</li>
                </ul>
              </div>
              
              <button id="submit-btn" class="btn btn-primary btn-block mt-4">确认提现</button>
            </div>
          </div>
          
          <!-- Withdraw History -->
          <div class="withdraw-history">
            <h3>近期提现记录</h3>
            <div class="card">
              <div class="card-body">
                <div id="withdraw-history-list">
                  <div class="loader-container">
                    <div class="loader"></div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      </div>
    </div>
  </div>

  <!-- Withdraw Confirmation Modal -->
  <div class="modal" id="confirmation-modal" style="display: none;">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <h3 class="modal-title">确认提现</h3>
          <button type="button" class="modal-close" data-dismiss="modal">&times;</button>
        </div>
        <div class="modal-body">
          <div class="confirmation-details">
            <div class="confirmation-item">
              <div class="confirmation-label">提现金额</div>
              <div class="confirmation-value" id="confirm-amount">¥0.00</div>
            </div>
            <div class="confirmation-item">
              <div class="confirmation-label">提现到</div>
              <div class="confirmation-value" id="confirm-bank-card">未选择银行卡</div>
            </div>
            <div class="confirmation-item">
              <div class="confirmation-label">手续费</div>
              <div class="confirmation-value">¥0.00 (免费)</div>
            </div>
            <div class="confirmation-divider"></div>
            <div class="confirmation-item">
              <div class="confirmation-label">实际到账</div>
              <div class="confirmation-value" id="confirm-actual-amount">¥0.00</div>
            </div>
          </div>
        </div>
        <div class="modal-footer">
          <button class="btn btn-outline" id="cancel-btn">取消</button>
          <button class="btn btn-primary" id="confirm-btn">确认提现</button>
        </div>
      </div>
    </div>
  </div>

  <!-- Scripts -->
  <script src="/js/utils/Utils.js"></script>
  <script src="/js/components/Toast.js"></script>
  <script src="/js/services/ApiService.js"></script>
  <script src="/js/components/TopNavBar.js"></script>
  <script src="/js/components/SideBar.js"></script>
  <script src="/js/pages/withdraw.js"></script>
</body>
</html>
